package com.jscm.openselect;

import com.jscm.openprocess.OpenProcessListView;
import com.jscm.showdata.SelectDataView;
import com.jscm.showdata.TagMomeory;
import com.scm.all.export.ByteUtils;
import com.scm.all.export.SystemUtils;
import com.scm.all.export.WindowOperationUtils;
import com.scm.x64.export.MemoryOperationUtilsX64;
import javafx.collections.FXCollections;
import javafx.collections.ObservableList;
import javafx.event.ActionEvent;
import javafx.event.EventHandler;
import javafx.scene.control.Button;
import org.apache.commons.lang3.StringUtils;

import java.util.Arrays;

/**
 * 首次搜索
 */
public class SelecthBoxSearchBtnTow {
    public static Button button = new Button();
    static {
        init();
    }

    private static void init() {
        button.setPrefWidth(80);
        button.setPrefHeight(40);
        button.setText("再次搜索");
        button.setId("SelectBtn");
        button.setOnAction(new EventHandler<ActionEvent>() {
            @Override
            public void handle(ActionEvent event) {
                SelecthBoxSearchBtnListAddress.flag=false;
                SelecthBoxSearchBtnListAddress.button.setText("开始列表刷新");
                ObservableList<TagMomeory> observableList = FXCollections.observableArrayList();
                observableList.clear();
                if(SelectTextType.TypeToBytes()){
                    for(int j = 0; j< SelectDataView.observableList.size(); j++){
//                        临时数据
                        int id = SelectTextType.comboBox.getSelectionModel().getSelectedIndex();
                        byte[] dataTemp = MemoryOperationUtilsX64.readProcessMemoryByte(OpenProcessListView.processHandler,ByteUtils.hexToLong2(SelectDataView.observableList.get(j).getHexData()),Integer.parseInt(SelectDataView.observableList.get(j).getLen()));
//                        划分基本数据类型
//                        这里主要是把完全匹配的数据类型进行进行过滤 可以理解为等号过滤
                        if(id<= 36  && id > -1){
//                            2字节字符操作
                            if(id >= 1 && id <= 4){
//                                两字节以内做判断  规划类型转换
                                char dat = ByteUtils.bytesArrayToChar(dataTemp);
                                char by = SelectText.textField.getText().charAt(0);
                                if(dat==by){
                                    TagMomeory tagMomeory = new TagMomeory(SelectDataView.observableList.get(j).getIsStatic(),SelectDataView.observableList.get(j).getHexData().toUpperCase(),""+dat,SelectDataView.observableList.get(j).getBaseAddress(),SelectDataView.observableList.get(j).getTypeData(),""+dataTemp.length);
                                    observableList.add(tagMomeory);
                                }
                            }
//                            2字节短整数操作
                            if(id >= 6 && id <= 9){
//                                两字节以内做判断  规划类型转换
                                short dat = ByteUtils.bytesArrayToShort1(dataTemp);
                                short by = ByteUtils.bytesArrayToShort1(ByteUtils.getObjectTypeToByte(SelectText.textField.getText(),"short"));
                                if(dat==by){
                                    TagMomeory tagMomeory = new TagMomeory(SelectDataView.observableList.get(j).getIsStatic(),SelectDataView.observableList.get(j).getHexData().toUpperCase(),""+dat,SelectDataView.observableList.get(j).getBaseAddress(),SelectDataView.observableList.get(j).getTypeData(),""+dataTemp.length);
                                    observableList.add(tagMomeory);
                                }
                            }
//                            4字节整数操作
                            if(id >= 11 && id <= 14){
//                                两字节以内做判断  规划类型转换
                                int dat = ByteUtils.bytesArrayToInt(dataTemp);
                                int by = ByteUtils.bytesArrayToInt(ByteUtils.getObjectTypeToByte(SelectText.textField.getText(),"int"));
                                if(dat==by){
                                    TagMomeory tagMomeory = new TagMomeory(SelectDataView.observableList.get(j).getIsStatic(),SelectDataView.observableList.get(j).getHexData().toUpperCase(),""+dat,SelectDataView.observableList.get(j).getBaseAddress(),SelectDataView.observableList.get(j).getTypeData(),""+dataTemp.length);
                                    observableList.add(tagMomeory);
                                }
                            }
//                            8 字节长整数操作
                            if(id >= 16 && id <= 19){
//                                两字节以内做判断  规划类型转换
                                long dat = ByteUtils.bytesArrayToLong1(dataTemp);
                                long by = ByteUtils.bytesArrayToLong1(ByteUtils.getObjectTypeToByte(SelectText.textField.getText(),"long"));
                                if(dat==by){
                                    TagMomeory tagMomeory = new TagMomeory(SelectDataView.observableList.get(j).getIsStatic(),SelectDataView.observableList.get(j).getHexData().toUpperCase(),""+dat,SelectDataView.observableList.get(j).getBaseAddress(),SelectDataView.observableList.get(j).getTypeData(),""+dataTemp.length);
                                    observableList.add(tagMomeory);
                                }
                            }
//                            4 字节浮点操作
                            if(id >= 21 && id <= 24){
//                                两字节以内做判断  规划类型转换
                                float dat = ByteUtils.bytesArrayToFloat1(dataTemp);
                                float by = ByteUtils.bytesArrayToFloat1(ByteUtils.getObjectTypeToByte(SelectText.textField.getText(),"float"));
                                if(dat==by){
                                    TagMomeory tagMomeory = new TagMomeory(SelectDataView.observableList.get(j).getIsStatic(),SelectDataView.observableList.get(j).getHexData().toUpperCase(),""+dat,SelectDataView.observableList.get(j).getBaseAddress(),SelectDataView.observableList.get(j).getTypeData(),""+dataTemp.length);
                                    observableList.add(tagMomeory);
                                }
                            }
//                            8 字节双精度整数操作
                            if(id >= 26 && id <= 29){
//                                两字节以内做判断  规划类型转换
                                double dat = ByteUtils.bytesArrayToDouble1(dataTemp);
                                double by = ByteUtils.bytesArrayToDouble1(ByteUtils.getObjectTypeToByte(SelectText.textField.getText(),"double"));
                                if(dat==by){
                                    TagMomeory tagMomeory = new TagMomeory(SelectDataView.observableList.get(j).getIsStatic(),SelectDataView.observableList.get(j).getHexData().toUpperCase(),""+dat,SelectDataView.observableList.get(j).getBaseAddress(),SelectDataView.observableList.get(j).getTypeData(),""+dataTemp.length);
                                    observableList.add(tagMomeory);
                                }
                            }
//                            字节数组操作
                            if(id == 31){
//                                两字节以内做判断  规划类型转换
                                byte[] dat = dataTemp;
                                byte[] by = ByteUtils.getObjectTypeToByte(ByteUtils.hexStrToBytes(SelectText.textField.getText()),"byte");
                                if(ByteUtils.equalsByteArray(dat, by)){
                                    TagMomeory tagMomeory = new TagMomeory(SelectDataView.observableList.get(j).getIsStatic(),SelectDataView.observableList.get(j).getHexData().toUpperCase(),ByteUtils.bytesToHexString(dat),SelectDataView.observableList.get(j).getBaseAddress(),SelectDataView.observableList.get(j).getTypeData(),""+dataTemp.length);
                                    observableList.add(tagMomeory);
                                }
                            }
//                            特征字节数组操作
                            if(id == 32){
//                                两字节以内做判断  规划类型转换
                                byte[] dat = dataTemp;
                                System.out.println(ByteUtils.bytesToHexString(dat));
                                byte[] by = ByteUtils.hexStrToBytes(SelectText.textField.getText());
                                if(ByteUtils.equalsByteArray(dat, by)){
                                    TagMomeory tagMomeory = new TagMomeory(SelectDataView.observableList.get(j).getIsStatic(),SelectDataView.observableList.get(j).getHexData().toUpperCase(),ByteUtils.bytesToHexString(dat),SelectDataView.observableList.get(j).getBaseAddress(),SelectDataView.observableList.get(j).getTypeData(),""+dataTemp.length);
                                    observableList.add(tagMomeory);
                                }
                            }
//                            Utf8操作
                            if(id == 34){
//                                两字节以内做判断  规划类型转换
                                String dat = ByteUtils.bytesArrayToUtf8(dataTemp);
                                String by = SelectText.textField.getText();
                                if(StringUtils.equals(dat, by)){
                                    TagMomeory tagMomeory = new TagMomeory(SelectDataView.observableList.get(j).getIsStatic(),SelectDataView.observableList.get(j).getHexData().toUpperCase(),""+dat,SelectDataView.observableList.get(j).getBaseAddress(),SelectDataView.observableList.get(j).getTypeData(),""+dataTemp.length);
                                    observableList.add(tagMomeory);
                                }
                            }
//                            UniCode操作
                            if(id == 35){
//                                两字节以内做判断  规划类型转换
                                String dat = ByteUtils.bytesArrayToUtf8(dataTemp);
                                String by = ByteUtils.bytesArrayToUtf8(ByteUtils.getObjectTypeToByte(SelectText.textField.getText(),"StringUniCode"));
                                if(StringUtils.equals(dat, by)){
                                    TagMomeory tagMomeory = new TagMomeory(SelectDataView.observableList.get(j).getIsStatic(),SelectDataView.observableList.get(j).getHexData().toUpperCase(),""+dat,SelectDataView.observableList.get(j).getBaseAddress(),SelectDataView.observableList.get(j).getTypeData(),""+dataTemp.length);
                                    observableList.add(tagMomeory);
                                }
                            }
//                            ASCII操作
                            if(id == 36){
//                                两字节以内做判断  规划类型转换
                                String dat = ByteUtils.bytesArrayToUtf8(dataTemp);
                                String by = SelectText.textField.getText();
                                if(StringUtils.equals(dat, by)){
                                    TagMomeory tagMomeory = new TagMomeory(SelectDataView.observableList.get(j).getIsStatic(),SelectDataView.observableList.get(j).getHexData().toUpperCase(),""+dat,SelectDataView.observableList.get(j).getBaseAddress(),SelectDataView.observableList.get(j).getTypeData(),""+dataTemp.length);
                                    observableList.add(tagMomeory);
                                }
                            }
                        }

//                        接下来处理非基础数据类型的数据再此搜索  ，大于操作  小于操作  不变操作  改变操作

//                        大于操作  必须位基础数据类型非文本类型
                        int index = Integer.parseInt(SelectDataView.observableList.get(j).getTypeData());
                        if(id==38){
//                            字符类型
                            if(index >= 1 && index <= 4){
//                                两字节以内做判断  规划类型转换
                                char dat = ByteUtils.bytesArrayToChar(dataTemp);
                                char by = SelectText.textField.getText().charAt(0);
                                if(dat > by){
                                    TagMomeory tagMomeory = new TagMomeory(SelectDataView.observableList.get(j).getIsStatic(),SelectDataView.observableList.get(j).getHexData().toUpperCase(),""+dat,SelectDataView.observableList.get(j).getBaseAddress(),SelectDataView.observableList.get(j).getTypeData(),""+dataTemp.length);
                                    observableList.add(tagMomeory);
                                }
                            }
//                            短整数
                            if(index >= 6 && index <= 9){
//                                两字节以内做判断  规划类型转换
                                short dat = ByteUtils.bytesArrayToShort1(dataTemp);
                                short by = ByteUtils.bytesArrayToShort1(ByteUtils.getObjectTypeToByte(SelectText.textField.getText(),"short"));
                                if(dat > by){
                                    TagMomeory tagMomeory = new TagMomeory(SelectDataView.observableList.get(j).getIsStatic(),SelectDataView.observableList.get(j).getHexData().toUpperCase(),""+dat,SelectDataView.observableList.get(j).getBaseAddress(),SelectDataView.observableList.get(j).getTypeData(),""+dataTemp.length);
                                    observableList.add(tagMomeory);
                                }
                            }
//                            4字节整数操作
                            if(index >= 11 && index <= 14){
//                                两字节以内做判断  规划类型转换
                                int dat = ByteUtils.bytesArrayToInt(dataTemp);
                                int by = ByteUtils.bytesArrayToInt(ByteUtils.getObjectTypeToByte(SelectText.textField.getText(),"int"));
                                if(dat > by){
                                    TagMomeory tagMomeory = new TagMomeory(SelectDataView.observableList.get(j).getIsStatic(),SelectDataView.observableList.get(j).getHexData().toUpperCase(),""+dat,SelectDataView.observableList.get(j).getBaseAddress(),SelectDataView.observableList.get(j).getTypeData(),""+dataTemp.length);
                                    observableList.add(tagMomeory);
                                }
                            }
//                            8 字节长整数操作
                            if(index >= 16 && index <= 19){
//                                两字节以内做判断  规划类型转换
                                long dat = ByteUtils.bytesArrayToLong1(dataTemp);
                                long by = ByteUtils.bytesArrayToLong1(ByteUtils.getObjectTypeToByte(SelectText.textField.getText(),"long"));
                                if(dat > by){
                                    TagMomeory tagMomeory = new TagMomeory(SelectDataView.observableList.get(j).getIsStatic(),SelectDataView.observableList.get(j).getHexData().toUpperCase(),""+dat,SelectDataView.observableList.get(j).getBaseAddress(),SelectDataView.observableList.get(j).getTypeData(),""+dataTemp.length);
                                    observableList.add(tagMomeory);
                                }
                            }
//                            4 字节浮点操作
                            if(index >= 21 && index <= 24){
//                                两字节以内做判断  规划类型转换
                                float dat = ByteUtils.bytesArrayToFloat1(dataTemp);
                                float by = ByteUtils.bytesArrayToFloat1(ByteUtils.getObjectTypeToByte(SelectText.textField.getText(),"float"));
                                if(dat > by){
                                    TagMomeory tagMomeory = new TagMomeory(SelectDataView.observableList.get(j).getIsStatic(),SelectDataView.observableList.get(j).getHexData().toUpperCase(),""+dat,SelectDataView.observableList.get(j).getBaseAddress(),SelectDataView.observableList.get(j).getTypeData(),""+dataTemp.length);
                                    observableList.add(tagMomeory);
                                }
                            }
//                            8 字节双精度整数操作
                            if(index >= 26 && index <= 29){
//                                两字节以内做判断  规划类型转换
                                double dat = ByteUtils.bytesArrayToDouble1(dataTemp);
                                double by = ByteUtils.bytesArrayToDouble1(ByteUtils.getObjectTypeToByte(SelectText.textField.getText(),"double"));
                                if(dat > by){
                                    TagMomeory tagMomeory = new TagMomeory(SelectDataView.observableList.get(j).getIsStatic(),SelectDataView.observableList.get(j).getHexData().toUpperCase(),""+dat,SelectDataView.observableList.get(j).getBaseAddress(),SelectDataView.observableList.get(j).getTypeData(),""+dataTemp.length);
                                    observableList.add(tagMomeory);
                                }
                            }
                        }

//                        小于条件的处理也是一样
                        if(id==39){
//                            字符类型
                            if(index >= 1 && index <= 4){
//                                两字节以内做判断  规划类型转换
                                char dat = ByteUtils.bytesArrayToChar(dataTemp);
                                char by = SelectText.textField.getText().charAt(0);
                                if(dat < by){
                                    TagMomeory tagMomeory = new TagMomeory(SelectDataView.observableList.get(j).getIsStatic(),SelectDataView.observableList.get(j).getHexData().toUpperCase(),""+dat,SelectDataView.observableList.get(j).getBaseAddress(),SelectDataView.observableList.get(j).getTypeData(),""+dataTemp.length);
                                    observableList.add(tagMomeory);
                                }
                            }
//                            短整数
                            if(index >= 6 && index <= 9){
//                                两字节以内做判断  规划类型转换
                                short dat = ByteUtils.bytesArrayToShort1(dataTemp);
                                short by = ByteUtils.bytesArrayToShort1(ByteUtils.getObjectTypeToByte(SelectText.textField.getText(),"short"));
                                if(dat < by){
                                    TagMomeory tagMomeory = new TagMomeory(SelectDataView.observableList.get(j).getIsStatic(),SelectDataView.observableList.get(j).getHexData().toUpperCase(),""+dat,SelectDataView.observableList.get(j).getBaseAddress(),SelectDataView.observableList.get(j).getTypeData(),""+dataTemp.length);
                                    observableList.add(tagMomeory);
                                }
                            }
//                            4字节整数操作
                            if(index >= 11 && index <= 14){
//                                两字节以内做判断  规划类型转换
                                int dat = ByteUtils.bytesArrayToInt(dataTemp);
                                int by = ByteUtils.bytesArrayToInt(ByteUtils.getObjectTypeToByte(SelectText.textField.getText(),"int"));
                                if(dat < by){
                                    TagMomeory tagMomeory = new TagMomeory(SelectDataView.observableList.get(j).getIsStatic(),SelectDataView.observableList.get(j).getHexData().toUpperCase(),""+dat,SelectDataView.observableList.get(j).getBaseAddress(),SelectDataView.observableList.get(j).getTypeData(),""+dataTemp.length);
                                    observableList.add(tagMomeory);
                                }
                            }
//                            8 字节长整数操作
                            if(index >= 16 && index <= 19){
//                                两字节以内做判断  规划类型转换
                                long dat = ByteUtils.bytesArrayToLong1(dataTemp);
                                long by = ByteUtils.bytesArrayToLong1(ByteUtils.getObjectTypeToByte(SelectText.textField.getText(),"long"));
                                if(dat < by){
                                    TagMomeory tagMomeory = new TagMomeory(SelectDataView.observableList.get(j).getIsStatic(),SelectDataView.observableList.get(j).getHexData().toUpperCase(),""+dat,SelectDataView.observableList.get(j).getBaseAddress(),SelectDataView.observableList.get(j).getTypeData(),""+dataTemp.length);
                                    observableList.add(tagMomeory);
                                }
                            }
//                            4 字节浮点操作
                            if(index >= 21 && index <= 24){
//                                两字节以内做判断  规划类型转换
                                float dat = ByteUtils.bytesArrayToFloat1(dataTemp);
                                float by = ByteUtils.bytesArrayToFloat1(ByteUtils.getObjectTypeToByte(SelectText.textField.getText(),"float"));
                                if(dat < by){
                                    TagMomeory tagMomeory = new TagMomeory(SelectDataView.observableList.get(j).getIsStatic(),SelectDataView.observableList.get(j).getHexData().toUpperCase(),""+dat,SelectDataView.observableList.get(j).getBaseAddress(),SelectDataView.observableList.get(j).getTypeData(),""+dataTemp.length);
                                    observableList.add(tagMomeory);
                                }
                            }
//                            8 字节双精度整数操作
                            if(index >= 26 && index <= 29){
//                                两字节以内做判断  规划类型转换
                                double dat = ByteUtils.bytesArrayToDouble1(dataTemp);
                                double by = ByteUtils.bytesArrayToDouble1(ByteUtils.getObjectTypeToByte(SelectText.textField.getText(),"double"));
                                if(dat < by){
                                    TagMomeory tagMomeory = new TagMomeory(SelectDataView.observableList.get(j).getIsStatic(),SelectDataView.observableList.get(j).getHexData().toUpperCase(),""+dat,SelectDataView.observableList.get(j).getBaseAddress(),SelectDataView.observableList.get(j).getTypeData(),""+dataTemp.length);
                                    observableList.add(tagMomeory);
                                }
                            }
                        }

//                        未改变的值
                        if(id ==43){
//                            字符类型
                            if(index >= 1 && index <= 4){
//                                两字节以内做判断  规划类型转换
                                char dat = ByteUtils.bytesArrayToChar(dataTemp);
                                char by = SelectText.textField.getText().charAt(0);
                                if(dat == by){
                                    TagMomeory tagMomeory = new TagMomeory(SelectDataView.observableList.get(j).getIsStatic(),SelectDataView.observableList.get(j).getHexData().toUpperCase(),""+dat,SelectDataView.observableList.get(j).getBaseAddress(),SelectDataView.observableList.get(j).getTypeData(),""+dataTemp.length);
                                    observableList.add(tagMomeory);
                                }
                            }
//                            短整数
                            if(index >= 6 && index <= 9){
//                                两字节以内做判断  规划类型转换
                                short dat = ByteUtils.bytesArrayToShort1(dataTemp);
                                short by = ByteUtils.bytesArrayToShort1(ByteUtils.getObjectTypeToByte(SelectText.textField.getText(),"short"));
                                if(dat == by){
                                    TagMomeory tagMomeory = new TagMomeory(SelectDataView.observableList.get(j).getIsStatic(),SelectDataView.observableList.get(j).getHexData().toUpperCase(),""+dat,SelectDataView.observableList.get(j).getBaseAddress(),SelectDataView.observableList.get(j).getTypeData(),""+dataTemp.length);
                                    observableList.add(tagMomeory);
                                }
                            }
//                            4字节整数操作
                            if(index >= 11 && index <= 14){
//                                两字节以内做判断  规划类型转换
                                int dat = ByteUtils.bytesArrayToInt(dataTemp);
                                int by = ByteUtils.bytesArrayToInt(ByteUtils.getObjectTypeToByte(SelectText.textField.getText(),"int"));
                                if(dat == by){
                                    TagMomeory tagMomeory = new TagMomeory(SelectDataView.observableList.get(j).getIsStatic(),SelectDataView.observableList.get(j).getHexData().toUpperCase(),""+dat,SelectDataView.observableList.get(j).getBaseAddress(),SelectDataView.observableList.get(j).getTypeData(),""+dataTemp.length);
                                    observableList.add(tagMomeory);
                                }
                            }
//                            8 字节长整数操作
                            if(index >= 16 && index <= 19){
//                                两字节以内做判断  规划类型转换
                                long dat = ByteUtils.bytesArrayToLong1(dataTemp);
                                long by = ByteUtils.bytesArrayToLong1(ByteUtils.getObjectTypeToByte(SelectText.textField.getText(),"long"));
                                if(dat == by){
                                    TagMomeory tagMomeory = new TagMomeory(SelectDataView.observableList.get(j).getIsStatic(),SelectDataView.observableList.get(j).getHexData().toUpperCase(),""+dat,SelectDataView.observableList.get(j).getBaseAddress(),SelectDataView.observableList.get(j).getTypeData(),""+dataTemp.length);
                                    observableList.add(tagMomeory);
                                }
                            }
//                            4 字节浮点操作
                            if(index >= 21 && index <= 24){
//                                两字节以内做判断  规划类型转换
                                float dat = ByteUtils.bytesArrayToFloat1(dataTemp);
                                float by = ByteUtils.bytesArrayToFloat1(ByteUtils.getObjectTypeToByte(SelectText.textField.getText(),"float"));
                                if(dat == by){
                                    TagMomeory tagMomeory = new TagMomeory(SelectDataView.observableList.get(j).getIsStatic(),SelectDataView.observableList.get(j).getHexData().toUpperCase(),""+dat,SelectDataView.observableList.get(j).getBaseAddress(),SelectDataView.observableList.get(j).getTypeData(),""+dataTemp.length);
                                    observableList.add(tagMomeory);
                                }
                            }
//                            8 字节双精度整数操作
                            if(index >= 26 && index <= 29){
//                                两字节以内做判断  规划类型转换
                                double dat = ByteUtils.bytesArrayToDouble1(dataTemp);
                                double by = ByteUtils.bytesArrayToDouble1(ByteUtils.getObjectTypeToByte(SelectText.textField.getText(),"double"));
                                if(dat == by){
                                    TagMomeory tagMomeory = new TagMomeory(SelectDataView.observableList.get(j).getIsStatic(),SelectDataView.observableList.get(j).getHexData().toUpperCase(),""+dat,SelectDataView.observableList.get(j).getBaseAddress(),SelectDataView.observableList.get(j).getTypeData(),""+dataTemp.length);
                                    observableList.add(tagMomeory);
                                }
                            }
                        }

//                        改变的值
                        if(id ==44){
//                            字符类型
                            if(index >= 1 && index <= 4){
//                                两字节以内做判断  规划类型转换
                                char dat = ByteUtils.bytesArrayToChar(dataTemp);
                                char by = SelectText.textField.getText().charAt(0);
                                if(dat != by){
                                    TagMomeory tagMomeory = new TagMomeory(SelectDataView.observableList.get(j).getIsStatic(),SelectDataView.observableList.get(j).getHexData().toUpperCase(),""+dat,SelectDataView.observableList.get(j).getBaseAddress(),SelectDataView.observableList.get(j).getTypeData(),""+dataTemp.length);
                                    observableList.add(tagMomeory);
                                }
                            }
//                            短整数
                            if(index >= 6 && index <= 9){
//                                两字节以内做判断  规划类型转换
                                short dat = ByteUtils.bytesArrayToShort1(dataTemp);
                                short by = ByteUtils.bytesArrayToShort1(ByteUtils.getObjectTypeToByte(SelectText.textField.getText(),"short"));
                                if(dat != by){
                                    TagMomeory tagMomeory = new TagMomeory(SelectDataView.observableList.get(j).getIsStatic(),SelectDataView.observableList.get(j).getHexData().toUpperCase(),""+dat,SelectDataView.observableList.get(j).getBaseAddress(),SelectDataView.observableList.get(j).getTypeData(),""+dataTemp.length);
                                    observableList.add(tagMomeory);
                                }
                            }
//                            4字节整数操作
                            if(index >= 11 && index <= 14){
//                                两字节以内做判断  规划类型转换
                                int dat = ByteUtils.bytesArrayToInt(dataTemp);
                                int by = ByteUtils.bytesArrayToInt(ByteUtils.getObjectTypeToByte(SelectText.textField.getText(),"int"));
                                if(dat != by){
                                    TagMomeory tagMomeory = new TagMomeory(SelectDataView.observableList.get(j).getIsStatic(),SelectDataView.observableList.get(j).getHexData().toUpperCase(),""+dat,SelectDataView.observableList.get(j).getBaseAddress(),SelectDataView.observableList.get(j).getTypeData(),""+dataTemp.length);
                                    observableList.add(tagMomeory);
                                }
                            }
//                            8 字节长整数操作
                            if(index >= 16 && index <= 19){
//                                两字节以内做判断  规划类型转换
                                long dat = ByteUtils.bytesArrayToLong1(dataTemp);
                                long by = ByteUtils.bytesArrayToLong1(ByteUtils.getObjectTypeToByte(SelectText.textField.getText(),"long"));
                                if(dat != by){
                                    TagMomeory tagMomeory = new TagMomeory(SelectDataView.observableList.get(j).getIsStatic(),SelectDataView.observableList.get(j).getHexData().toUpperCase(),""+dat,SelectDataView.observableList.get(j).getBaseAddress(),SelectDataView.observableList.get(j).getTypeData(),""+dataTemp.length);
                                    observableList.add(tagMomeory);
                                }
                            }
//                            4 字节浮点操作
                            if(index >= 21 && index <= 24){
//                                两字节以内做判断  规划类型转换
                                float dat = ByteUtils.bytesArrayToFloat1(dataTemp);
                                float by = ByteUtils.bytesArrayToFloat1(ByteUtils.getObjectTypeToByte(SelectText.textField.getText(),"float"));
                                if(dat != by){
                                    TagMomeory tagMomeory = new TagMomeory(SelectDataView.observableList.get(j).getIsStatic(),SelectDataView.observableList.get(j).getHexData().toUpperCase(),""+dat,SelectDataView.observableList.get(j).getBaseAddress(),SelectDataView.observableList.get(j).getTypeData(),""+dataTemp.length);
                                    observableList.add(tagMomeory);
                                }
                            }
//                            8 字节双精度整数操作
                            if(index >= 26 && index <= 29){
//                                两字节以内做判断  规划类型转换
                                double dat = ByteUtils.bytesArrayToDouble1(dataTemp);
                                double by = ByteUtils.bytesArrayToDouble1(ByteUtils.getObjectTypeToByte(SelectText.textField.getText(),"double"));
                                if(dat != by){
                                    TagMomeory tagMomeory = new TagMomeory(SelectDataView.observableList.get(j).getIsStatic(),SelectDataView.observableList.get(j).getHexData().toUpperCase(),""+dat,SelectDataView.observableList.get(j).getBaseAddress(),SelectDataView.observableList.get(j).getTypeData(),""+dataTemp.length);
                                    observableList.add(tagMomeory);
                                }
                            }
                        }

//                        过滤长度为0的值
                        if(id==45){
                            if(!StringUtils.equals(SelectDataView.observableList.get(j).getUpdateValue(),"")&& !StringUtils.equals(SelectDataView.observableList.get(j).getUpdateValue(),"0") && !StringUtils.equals(SelectDataView.observableList.get(j).getUpdateValue(),"00") && !StringUtils.equals(SelectDataView.observableList.get(j).getUpdateValue(),null) && !StringUtils.equals(SelectDataView.observableList.get(j).getUpdateValue(),"0.0") && !StringUtils.equals(SelectDataView.observableList.get(j).getUpdateValue(),"0.00")){
                                TagMomeory tagMomeory = new TagMomeory(SelectDataView.observableList.get(j).getIsStatic(),SelectDataView.observableList.get(j).getHexData().toUpperCase(),SelectDataView.observableList.get(j).getUpdateValue(),SelectDataView.observableList.get(j).getBaseAddress(),SelectDataView.observableList.get(j).getTypeData(),""+dataTemp.length);
                                observableList.add(tagMomeory);
                            }
                        }
                    }
                    SelectDataView.observableList = observableList;
                    SelectDataView.tableView.setItems(SelectDataView.observableList);
                    SelecthBoxSearchBtnListAddress.flag=true;
                    SelecthBoxSearchBtnListAddress.button.setText("停止列表刷新");
                }
            }
        });
    }
}
